package state.group.events;

import messages.ByteList;

public class DirectionEvent extends ElevatorEvent {
    
    private byte direction;

    public DirectionEvent(byte[] data, int startIndex)
    {
        super(data, startIndex);
        this.direction = data[startIndex + 2];
    }
    
    public DirectionEvent(byte elevatorId, byte direction)
    {
        super(elevatorId);
        this.direction = direction;
    }
    
    public byte getDirection()
    {
        return direction;
    }
    
    public void appendToByteList(ByteList list)
    {
        super.appendToByteList(list);
        list.addByte(direction);
    }

    @Override
    public int getEventByteLength()
    {
        return 3;
    }

    @Override
    public EventType getEventType()
    {
        return EventType.DirectionEvent;
    }
    
}
